﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FbKPI.Model;
using FbKPI.Controller;

namespace FbKPI.Facade
{
    public class CategoryKPIFacade
    {
        public string Save(CategoryKPI Categories)
        {
            CategoryKPIController cont = new CategoryKPIController();
            return cont.Save(Categories);
        }

        public string Delete(CategoryKPI Categories)
        {
            CategoryKPIController cont = new CategoryKPIController();
            return cont.Delete(Categories);
        }

        public string BeforeDelete(CategoryKPI Categories)
        {
            CategoryKPIController cont = new CategoryKPIController();
            return cont.BeforeDelete(Categories);
        }

        public IList<CategoryKPI> GetAll(string sSearch, int PageNumber, int DataLength, string SortCol, string SortDirection, out int TotalData)
        {
            IList<CategoryKPI> Categories = new List<CategoryKPI>();
            CategoryKPIController cont = new CategoryKPIController();
            Categories = cont.GetAll(sSearch, PageNumber, DataLength, SortCol, SortDirection, out TotalData);
            return Categories;
        }

        public IList<CategoryKPI> GetAllCategoryKPIByGroupKPI(int GroupKPIID, string sSearch, int PageNumber, int DataLength, int SortCol, string SortDirection, out int TotalData)
        {
            IList<CategoryKPI> Categories = new List<CategoryKPI>();
            CategoryKPIController cont = new CategoryKPIController();
            Categories = cont.GetAllCategoryKPIsByGroupKPIID(GroupKPIID, sSearch, PageNumber, DataLength, SortCol, SortDirection, out TotalData);
            return Categories;
        }

        public CategoryKPI GetCategoryKPIByID(int ID)
        {
            CategoryKPI Categories = new CategoryKPI();
            CategoryKPIController cont = new CategoryKPIController();
            Categories = cont.GetCategoryKPIByID(ID);
            return Categories;
        }

        public CategoryKPI GetCategoryKPIByDescription(string Description, int GroupID)
        {
            CategoryKPI Categories = new CategoryKPI();
            CategoryKPIController cont = new CategoryKPIController();
            Categories = cont.GetCategoryKPIByDescription(Description, GroupID);
            return Categories;
        }
    }
}